<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改用工合同')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-employmentContract-add" th:object="${employmentContract}">
            <input type="hidden" name="ecId" th:value="*{ecId}">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">序号：</label>
                <div class="col-sm-8">
                    <input name="num" class="form-control" type="text" th:value="*{num}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">姓名：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text" th:value="*{name}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">部门：</label>
                <div class="col-sm-8">
                    <input name="department" class="form-control" type="text" th:value="*{department}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">职务：</label>
                <div class="col-sm-8">
                    <input name="post" class="form-control" type="text" th:value="*{post}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">合同类型：</label>
                <div class="col-sm-8">
                    <select name="contractType" class="form-control" th:field="*{contractType}">
                        <option value="1">劳动合同</option>
                        <option value="2">劳动协议</option>
                        <option value="3">聘用协议</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">起始日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date" >
                        <input autocomplete="off" type="text" class="time-input form-control" id="startTime" placeholder="请填写日期"  name="startTime" th:value="*{#dates.format(startTime, 'yyyy-MM-dd')}" />
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label ">结束日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date" >
                        <input autocomplete="off" type="text" class="time-input form-control" id="endTime" placeholder="请填写日期"  name="endTime" th:value="*{#dates.format(endTime, 'yyyy-MM-dd')}" />
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label ">状态：</label>
                <div class="col-sm-8">
                    <select name="status" class="form-control" th:field="*{status}">
                        <option value="1">正常</option>
                        <option value="2">到期</option>
                        <option value="3">终止</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text" th:value="*{remark}">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "hrm/employmentContract";


        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-employmentContract-add').serialize());
            }
        }

    </script>
</body>
</html>